package com.kgc.skProvider.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.collection.pojo.SalesReceivable;
import com.kgc.collection.remote.SalesReceivableRemote;
import com.kgc.skProvider.service.SalesReceivableService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.Map;
@Controller
public class SalesReceivableController implements SalesReceivableRemote {

    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private SalesReceivableService salesReceivableService;

    @Override
    public ResponseMsg selectSalesReceivableByPage(Map<String, Object> map) {
        logger.info("SalesReceivableController selectSalesReceivableByPage params {}", map.toString());
        ResponseMsg responseMsg =salesReceivableService.selectSalesReceivableByPage(map);
        logger.info("SalesReceivableController selectSalesReceivableByPage responseMsg {}", responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg insertSalesReceivable(SalesReceivable salesReceivable) {
        logger.info("SalesReceivableController insertSalesReceivable params {}", salesReceivable.toString());
        ResponseMsg responseMsg = salesReceivableService.insertSalesReceivable(salesReceivable);
        logger.info("SalesReceivableController insertSalesReceivable responseMsg {}", responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg updateSalesReceivable(SalesReceivable salesReceivable) {
        logger.info("SalesReceivableController updateSalesReceivable params {}", salesReceivable.toString());
        ResponseMsg responseMsg = salesReceivableService.updateSalesReceivable(salesReceivable);
        logger.info("SalesReceivableController updateSalesReceivable responseMsg {}", responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg deleteSalesReceivable(Map<String, Object> map) {
        logger.info("SalesReceivableController deleteSalesReceivable params {}", map.toString());
        ResponseMsg responseMsg=salesReceivableService.deleteSalesReceivable(map);
        logger.info("SalesReceivableController deleteSalesReceivable responseMsg {}", responseMsg);
        return responseMsg;
    }
}
